const webpack = require('webpack');
const path = require('path');
const {
  override,
  overrideDevServer,
  addWebpackAlias
} = require('customize-cra');

console.log('打印')
const devServerConfig = () => config => {
  return {
    ...config,
    proxy:{
      '/api':{
        target:'http://localhost:8080',
        changeOrigin:true,
        secure:false
      },
      '/xuqing_test':{
        target:'https://wrdata-test.s3.cn-northwest-1.amazonaws.com.cn',
        changeOrigin:true,
        secure:false
      }
    }
  }
}

module.exports = {
  webpack:override(
    addWebpackAlias({
      '@': path.resolve(__dirname, 'src')
    })
  ),
 devServer:overrideDevServer(devServerConfig())
} 